const objArr = [{
    name:'njy',
    pass:true
},{
    name:'cxh',
    pass:true
}]

const str = JSON.stringify(objArr);
console.log(str);
console.log(JSON.parse(str)[0]);
localStorage.setItem('xueyuan',str);